import type Response_Dto from "@/dto/response/Api_Result"
import request from "@/utils/request"

/**
 * 获取客户列表
 * @returns
 */
export const Get_Customers = (obj: { page: number; limit: number; key: string; }): Promise<Response_Dto> => {
    return request({
        url: 'api/Customer/Get_Customers',
        method: 'GET',
        params: obj
    })
}
/**
 * 获取客户列表
 * @returns
 */
export const Get_Customers_HighSeas = (obj: { page: number; limit: number; key: string; }): Promise<Response_Dto> => {
  return request({
      url: 'api/Customer/Get_Customers_HighSeas',
      method: 'GET',
      params: obj
  })
}

/**
 * 新增客户
 * @param obj
 * @returns
 */
export const Add_Customer = (obj: any): Promise<Response_Dto> => {
    return request({
        url: 'api/Customer/Add_Customer',
        method: 'POST',
        data: obj
    })
}

/**
 * 获取来源下拉框
 * @param obj
 * @returns
 */
export const Get_Origin = (obj: { keys: string[] }): Promise<Response_Dto> => {
    return request({
        url: 'api/Customer/Get_Origin',
        method: 'GET',
        params: obj
    })
}

/**
 * 获取等级下拉框
 * @param obj
 * @returns
 */
export const Get_Level = (obj: { keys: string[] }): Promise<Response_Dto> => {
    return request({
        url: 'api/Customer/Get_Level',
        method: 'GET',
        params: obj
    })
}

/**
 * 获取类型下拉框
 * @param obj
 * @returns
 */
export const Get_Type = (obj: { keys: string[] }): Promise<Response_Dto> => {
    return request({
        url: 'api/Customer/Get_Type',
        method: 'GET',
        params: obj
    })
}

/**
 * 获取负责人下拉框
 * @param obj
 * @returns
 */
export const Get_user = (obj: { keys: string[] }): Promise<Response_Dto> => {
    return request({
        url: 'api/Customer/Get_user',
        method: 'GET',
        params: obj
    })
}

/**
 * 获取单个客户的跟进记录
 * @param obj
 * @returns
 */
export const Get_Single_Customer_Records = (obj: { id: string }): Promise<Response_Dto> => {
    return request({
        url: 'api/Customer/Get_Single_Customer_Records',
        method: 'GET',
        params: obj
    })
}

/**
 * 新增跟进记录
 * @param obj
 * @returns
 */
export const Add_Record = (obj: any): Promise<Response_Dto> => {
    return request({
        url: 'api/Customer/Add_Record',
        method: 'POST',
        data: obj
    })
}

/**
 * 获取客户详情
 * @param obj
 * @returns
 */
export const Get_Customer_Details = (obj: { id: string }): Promise<Response_Dto> => {
    return request({
        url: 'api/Customer/Get_Customer_Details',
        method: 'GET',
        params: obj
    })
}

/**
 * 修改客户详情
 * @param obj
 * @returns
 */
export const Update_Customer_Details = (obj: { id: string, name: string, type: string, address: string, source: string, phone: string, next_time: string, seas_time: string, explain: string }): Promise<Response_Dto> => {
    return request({
        url: 'api/Customer/Update_Customer_Details',
        method: 'POST',
        data: obj
    })
}

/**
 * 修改客户详情
 * @param obj
 * @returns
 */
export const update_Customer = (obj: { id: string}): Promise<Response_Dto> => {
  return request({
      url: 'api/Customer/Update_Customer',
      method: 'POST',
      params: obj
  })
}
